﻿using System;
using System.Collections.Generic;
using System.Deployment.Application;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace D3StatsClient.Commands
{
    public class OpenSessionsFolder : CommandBase
    {
        public override bool CanExecute(object parameter)
        {
            return true;
        }

        public override void Execute(object parameter)
        {
            string folderPath = string.Empty;

            if (ApplicationDeployment.IsNetworkDeployed)
            {
                folderPath = string.Format("{0}\\{1}", ApplicationDeployment.CurrentDeployment.DataDirectory, Properties.Settings.Default.XMLStatsContainer);
            }
            else
            {
                folderPath = string.Format("{0}", AppDomain.CurrentDomain.BaseDirectory + Properties.Settings.Default.XMLStatsContainer);
            }

            if(folderPath != null && folderPath != string.Empty)
            {
                Process.Start(folderPath);
            }
        }
    }
}
